package com.dc.controller;

import com.dc.annotation.Log;
import com.dc.common.ResponseResultVO;
import com.dc.entity.HiddenDangerOrder;
import com.dc.entity.ro.HiddenDangerOrderRO;
import com.dc.entity.vo.HiddenDangerVO;
import com.dc.service.HiddenDangerOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

@Api(tags = "安全隐患工单管理")
@RestController
@RequestMapping("/hiddenDangerOrder")
public class HiddenDangerOrderController {

    @Resource
    private HiddenDangerOrderService hiddenDangerOrderService;


    @Log(title = "安全隐患工单管理", businessDesc = "增加")
    @ApiOperation(value = "增加", notes = "增加")
    @PostMapping("/insertHiddenDangerOrder")
    public ResponseResultVO insertHiddenDangerOrder(@RequestBody HiddenDangerOrderRO ro) {
        return hiddenDangerOrderService.insertHiddenDangerOrder(ro);
    }


    @Log(title = "安全隐患工单管理", businessDesc = "修改")
    @ApiOperation(value = "修改", notes = "修改")
    @PostMapping("/updateHiddenDangerOrder")
    public ResponseResultVO updateHiddenDangerOrder(@RequestBody HiddenDangerOrderRO ro) {
        return hiddenDangerOrderService.updateHiddenDangerOrder(ro);
    }


    @Log(title = "安全隐患工单管理", businessDesc = "删除")
    @ApiOperation(value = "删除", notes = "删除")
    @GetMapping("/deleteHiddenDangerOrder")
    public ResponseResultVO deleteHiddenDangerOrder(@RequestParam String id) {
        return hiddenDangerOrderService.deleteHiddenDangerOrder(id);
    }

    @ApiOperation(value = "查询列表", notes = "查询列表")
    @PostMapping("/selectHiddenDangerOrderList")
    public ResponseResultVO<HiddenDangerVO> selectHiddenDangerOrderList(@RequestBody HiddenDangerOrderRO ro) {
        return hiddenDangerOrderService.selectHiddenDangerOrderList(ro);
    }

    @ApiOperation(value = "列表导出", notes = "列表导出")
    @PostMapping("/hiddenDangerOrderRecordExport")
    public void hiddenDangerOrderRecordExport(HttpServletResponse response, @RequestBody HiddenDangerOrderRO ro) {
        hiddenDangerOrderService.hiddenDangerOrderRecordExport(response, ro);
    }


}
